package com.jason.common.error;

/**
 *
 * 包装器设计模式
 */
public class BusinessException extends Exception implements CommonError{

    private CommonError commonError;

    public BusinessException(CommonError commonError){
        super();
        this.commonError = commonError;
    }
    public BusinessException(CommonError commonError, String errMsg){
        super();
        commonError.setErrMsg(errMsg);
        this.commonError = commonError;
    }
    @Override
    public String getErrCode() {
        return commonError.getErrCode();
    }

    @Override
    public String getErrMsg() {
        return commonError.getErrMsg();
    }

    @Override
    public void setErrMsg(String errMsg) {
        this.commonError.setErrMsg(errMsg);
    }
}
